package com.loren.demo03.springboot;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/netty")
public class NettyController {

    private final NettyClient nettyClient;

    @GetMapping("/send")
    public String send(@RequestParam("message") String message) throws InterruptedException {
        this.nettyClient.sendMessage(message);
        return "success";
    }

}
